<template>
	<view class="error-container" v-if="isShow">
		<view v-if="type==1">
			<view>
				<image src="https://www.huangjinya.cn/xcx/dingdanweikong.png">
			</view>
			<view class="text-lg" style="margin-top:40upx">没有查询到订单哦</view>
			<view style="margin-top:50upx" class="empty-btn" @click="goCategory">去选购</view>
		</view>

		<view v-if="type==2">
			<view>
				<image src="https://www.huangjinya.cn/xcx/empty_cart.png">
			</view>
			<view class="text-lg" style="margin-top:40upx">购物车空空如也~</view>
			<view class="text-base text-color-grey" style="margin-top:20upx">快去挑选宝贝吧</view>
			<view style="margin-top:50upx" class="empty-btn" @click="goCategory">去逛逛</view>
		</view>


		<view v-if="type==3">
			<view>
				<image src="https://www.huangjinya.cn/xcx/dingdanweikong.png">
			</view>
			<view class="text-lg" style="margin-top:40upx">暂无商品~</view>
			<view class="text-base text-color-grey" style="margin-top:20upx">去看看其他宝贝吧</view>
		</view>
	</view>
</template>
<script>
	export default {
		props: {
			isShow: {
				type: Boolean,
				default: false
			},
			type: {
				type: Number,
				default: 0
			}
		},
		data() {
			return {}
		},

		methods: {
			close() {
				this.isShow = false
			},
			open() {
				this.isShow = true
			},

			goCategory() {
				uni.switchTab({
					url: '/pages/category/category'
				});
			},
		}
	}
</script>
<style lang="scss">
	.error-container {
		position: relative;
		z-index: 999;
		padding-top: 50%;
		text-align: center;

		image {
			width: 100upx;
			height: 100upx;
		}

		.empty-btn {
			border-radius: 10upx;
			display: inline-block;
			padding: 16upx 40upx;
			color: #fff;
			background-color: $uni-color-green;
		}
	}
</style>